package cn.stylefeng.guns.modular.system.mapper;

import cn.stylefeng.guns.modular.system.entity.PurchaseOrders;
import cn.stylefeng.guns.modular.system.model.params.PurchaseOrdersParam;
import cn.stylefeng.guns.modular.system.model.params.paramsDTO.CustomSaleDetailDTO;
import cn.stylefeng.guns.modular.system.model.params.paramsDTO.PurchaseOrderDTO;
import cn.stylefeng.guns.modular.system.model.result.PurchaseOrdersResult;
import cn.stylefeng.guns.modular.system.model.result.resultVO.ProductDetailList;
import cn.stylefeng.guns.modular.system.model.result.resultVO.PurchaseDetailVO;
import cn.stylefeng.guns.modular.system.model.result.resultVO.PurchaseVO;
import cn.stylefeng.guns.modular.system.model.result.resultVO.SendIndentOrderVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 订货单表 Mapper 接口
 * </p>
 *
 * @author 飞
 * @since 2019-07-02
 */
@Repository
public interface PurchaseOrdersMapper extends BaseMapper<PurchaseOrders> {

    /**
     * 获取列表
     *
     * @author 飞
     * @Date 2019-07-02
     */
    List<PurchaseOrdersResult> customList(@Param("paramCondition") PurchaseOrdersParam paramCondition);

    /**
     * 获取map列表
     *
     * @author 飞
     * @Date 2019-07-02
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") PurchaseOrdersParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author 飞
     * @Date 2019-07-02
     */
    Page<PurchaseOrdersResult> customPageList(@Param("page") Page page, @Param("paramCondition") PurchaseOrdersParam paramCondition);

    /**
     * 获取分页map列表
     *
     * @author 飞
     * @Date 2019-07-02
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") PurchaseOrdersParam paramCondition);


    /**
     * 产品详情
     * @param page
     * @param ids
     * @return
     */
    IPage<ProductDetailList> purchaseDetail(@Param("page") Page page,@Param("ids") List<Long> ids,@Param("dealer") Long dealer);
    /**
     * 产品
     * @param
     * @param
     * @return
     */

    List<PurchaseDetailVO> selectPurchase(@Param("idss") List<Long> ids);

    /**
     * 获取当前登录用户订货单中的购物详情
     * @param ids
     * @return
     */
    Page<SendIndentOrderVO>getPurchaseByDealer(@Param("page") Page page, @Param("ids") List<Long> ids,@Param("userId") Long userId);

    Page<PurchaseOrderDTO> getDispatchList(@Param("page") Page page, @Param("ids") List<Long> ids);



    Page<PurchaseVO> getPurchaseArray(@Param("page") Page page,@Param("ids") List<Long> ids);

    /**
     * 小程序消费者售后接口
     * @param page
     * @param ids
     * @return
     */
    Page<CustomSaleDetailDTO> getCustomDetail(@Param("page") Page page,@Param("ids") List<Long> ids);



}
